<?php

namespace app\admin\model\teacher;

use think\Model;


class Teacher extends Model
{

    // 表名
    protected $name = 'teacher';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = false;

    // 追加属性
    protected $append = [

    ];
    
    /**
     * 获取教师姓名
     */
    public function get_teacher_name($id)
    {
        $name = self::where('id',$id)->value('name');
        return $name;
    }

    /**
     * 获取教师头像
     */
    public function get_teacher_headimg($id)
    {
        $headimg = self::where('id',$id)->value('headimg');
        return $headimg;
    }
    
    /**
     * 获取教师昵称
     */
    public function get_teacher_nickname($id)
    {
        $name = self::where('id',$id)->value('nickname');
        return $name;
    }






}
